package com.proxy;

public class Test {
    public static void main(String[] args) {
        //静态代理模式
//        UserServicesImpl userServices =new UserServicesImpl();
//        ProxyUserServicesImpl proxyUserServices = new ProxyUserServicesImpl();
//        proxyUserServices.setUserServices(userServices);
//        proxyUserServices.add();

        //动态代理模式
        //真实角色
        UserServicesImpl userServices =new UserServicesImpl();
        //代理角色  现在没有
        DongProxyUserServices dongProxyUserServices =new DongProxyUserServices();
        //通过调佣程序处理角色来处理我们要调用的接口对象
        //设置要代理的对象
        dongProxyUserServices.setObject(userServices);
        //动态生成代理类
        UserServices proxy = (UserServices) dongProxyUserServices.getProxy();
        proxy.del();
    }
}
